/**
 @file ctc_acl.h

 @date 2012-10-19

 @version v2.0

 The file define api struct used in ACL.
*/

#ifndef _CTC_ACL_H_
#define _CTC_ACL_H_

#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************
 *
 * Header Files
 *
 ***************************************************************/

#include "common/include/ctc_const.h"
#include "common/include/ctc_macro.h"
#include "common/include/ctc_common.h"
#include "common/include/ctc_field.h"
#include "common/include/ctc_xdata.h"

/****************************************************************
*
* Defines and Macros
*
****************************************************************/
#define  CTC_ACL_GROUP_ID_NORMAL         0xFFFF0000  /**< [GB.GG.D2.TM.TMM.AT]Max normal group id */
/* Below groups are created already, just use it */
#define  CTC_ACL_GROUP_ID_HASH_MAC       0xFFFF0001  /**< [GB.GG.D2.TM.TMM.AT]Max hash mac group id */
#define  CTC_ACL_GROUP_ID_HASH_IPV4      0xFFFF0002  /**< [GB.GG.D2.TM.TMM.AT]Max hash ipv4 group id */
#define  CTC_ACL_GROUP_ID_HASH_MPLS      0xFFFF0003  /**< [GG.D2.TM.TMM.AT]Max hash mpls group id */
#define  CTC_ACL_GROUP_ID_HASH_L2_L3     0xFFFF0004  /**< [GG.D2.TM.TMM.AT]Max hash L2_L3 group id */
#define  CTC_ACL_GROUP_ID_HASH_IPV6      0xFFFF0005  /**< [GG.D2.TM.TMM.AT]Max hash ipv6 group id */
#define  CTC_ACL_GROUP_ID_HASH_RSV_0     0xFFFF0006  /**< [GG.D2.TM.TMM.AT]Max hash rsv_0 group id */
#define  CTC_ACL_GROUP_ID_MAX            0xFFFF0007  /**< [GB.GG.D2.TM.TMM.AT]Always last group id. Invalid group id */
#define  CTC_ACL_ENTRY_PRIORITY_HIGHEST  0xFFFFFFFF  /**< [GB.GG.D2.TM.TMM.AT]Highest acl entry priority */
#define  CTC_ACL_ENTRY_PRIORITY_LOWEST   0           /**< [GB.GG.D2.TM.TMM.AT]Lowest acl entry priority */
#define  CTC_ACL_ENTRY_PRIORITY_DEFAULT  1           /**< [GB.GG.D2.TM.TMM.AT]Default acl entry priority */

#define  CTC_ACL_KEY_SIZE_SINGLE         0           /**< [GG]Single acl key size */
#define  CTC_ACL_KEY_SIZE_DOUBLE         1           /**< [GG]Double acl key size */

#define  CTC_ACL_UDF_BYTE_NUM            16           /**< [GB.GG.D2.TM.TMM.AT]Acl udf byte number */
#define  CTC_ACL_UDF_FIELD_NUM           8            /**< [D2.TM.TMM.AT] number of ACL udf field */

#define  CTC_ACL_MAX_USER_ENTRY_ID       0xFFFF0000  /**< [GB.GG.D2.TM.TMM.AT]Max acl user entry id */
#define  CTC_ACL_MIN_USER_ENTRY_ID       0           /**< [GB.GG.D2.TM.TMM.AT]Min acl user entry id */

#define CTC_ACL_NSH_OP_TYPE_INSERT  1
#define CTC_ACL_NSH_OP_TYPE_REPLACE 2
#define CTC_ACL_NSH_OP_TYPE_REMOVE  3

/****************************************************************
*
* Data Structures
*
****************************************************************/

/**
@brief  ACl Key Type
*/
enum ctc_acl_key_type_e
{
    CTC_ACL_KEY_MAC = 0,            /**< [GB.GG.D2.TM.TMM.TMA.AT] ACL MAC key type */
    CTC_ACL_KEY_IPV4,               /**< [GB.GG.D2.TM.TMM.TMA.AT] ACL IPv4 key type */
    CTC_ACL_KEY_MPLS,               /**< [GB.GG] ACL MPLS key type;In DT2,replaced by CTC_ACL_KEY_MAC_IPV4*/
    CTC_ACL_KEY_IPV6,               /**< [GB.GG.D2.TM.TMM.TMA.AT] Mode 0: ACL Mac+IPv6 key type;
                                                        Mode 1: ACL Ipv6 key type */
    CTC_ACL_KEY_HASH_MAC,           /**< [GB.GG.D2.TM.TMM.AT] ACL MAC Hash key type */
    CTC_ACL_KEY_HASH_IPV4,          /**< [GB.GG.D2.TM.TMM.AT] ACL IPv4 Hash key type */
    CTC_ACL_KEY_HASH_L2_L3,         /**< [GG.D2.TM.TMM.AT] ACL L2 L3 Hash key type */
    CTC_ACL_KEY_HASH_MPLS,          /**< [GG.D2.TM.TMM.AT] ACL MPLS Hash key type */
    CTC_ACL_KEY_HASH_IPV6,          /**< [GG.D2.TM.TMM.AT] ACL IPv6 Hash key type */
    CTC_ACL_KEY_HASH_NSH,           /**< [AT] ACL NSH Hash key type */
    CTC_ACL_KEY_PBR_IPV4,           /**< [GB.GG] ACL PBR IPv4 key type ;From DT2,replaced by CTC_ACL_KEY_IPV4 */
    CTC_ACL_KEY_PBR_IPV6,           /**< [GB.GG] ACL PBR IPv6 key type ;From DT2,replaced by CTC_ACL_KEY_IPV6 */

    CTC_ACL_KEY_IPV4_EXT,           /**< [D2.TM.TMM.TMA.AT] ACL IPv4 extend key type */
    CTC_ACL_KEY_MAC_IPV4,           /**< [D2.TM.TMM.TMA.AT] ACL Mac+IPv4 key type */
    CTC_ACL_KEY_MAC_IPV4_EXT,       /**< [D2.TM.TMM.AT] ACL Mac+IPv4 extend key type */
    CTC_ACL_KEY_IPV6_EXT,           /**< [D2.TM.TMM.TMA.AT] ACL IPv6 extend key type */
    CTC_ACL_KEY_MAC_IPV6,           /**< [D2.TM.TMM.TMA.AT] ACL Mac+IPv6 extend key type */
    CTC_ACL_KEY_CID,                /**< [D2.TM.TMM.AT] ACL Category Id key type */
    CTC_ACL_KEY_INTERFACE,          /**< [D2.TM.TMM.AT] ACL Interface key type */
    CTC_ACL_KEY_FWD,                /**< [D2.TM.TMM.AT] ACL Forward key type */
    CTC_ACL_KEY_FWD_EXT,            /**< [D2.TM.TMM.AT] ACL Forward key type */
    CTC_ACL_KEY_COPP,               /**< [D2.TM.TMM.AT] ACL Copp key type */
    CTC_ACL_KEY_COPP_EXT,           /**< [D2.TM.TMM.AT] ACL Copp extend key type */

    CTC_ACL_KEY_UDF,                /**< [TM.TMM.TMA.AT] ACL UDF key type */
    CTC_ACL_KEY_STK_HDR,            /**< [TMM.AT] ACL Stacking Header key type */
    CTC_ACL_KEY_MAC_EXT,            /**< [TMA] Key160_macudf_view0 */
    CTC_ACL_KEY_FLEX_BASE=32,       /**< [TMM.AT] ACL flex key type base */
    CTC_ACL_KEY_FLEX_END=255,       /**< [TMM.AT] ACL flex key type max */
    CTC_ACL_KEY_NUM
};
typedef enum ctc_acl_key_type_e ctc_acl_key_type_t      ;

enum ctc_acl_field_action_type_e
{
    CTC_ACL_FIELD_ACTION_CP_TO_CPU,             /**< [D2.TM.TMM.TMA.AT] Copy To Cpu;refer to ctc_acl_to_cpu_t */
    CTC_ACL_FIELD_ACTION_STATS,                 /**< [D2.TM.TMM.TMA.AT] Packet Statistics; data0: Stats Id; data1: don't care discard pkt(valid only TMM) */
    CTC_ACL_FIELD_ACTION_RANDOM_LOG,            /**< [D2.TM.TMM.TMA.AT] Random Log, the Destination is config by mirror; data0: Log Id; data1: ctc_log_percent_t; ext_data: ctc_acl_log_t */
    CTC_ACL_FIELD_ACTION_COLOR,                 /**< [D2.TM.TMM.AT] Change Color; data0: New Color (ctc_qos_color_t); data1: color bitmap (ctc_qos_color_t); */
    CTC_ACL_FIELD_ACTION_DSCP,                  /**< [D2.TM.TMM.TMA.AT] Dscp(only support ingress direction); data0: New Dscp; data1: color (ctc_qos_color_t)*/
    CTC_ACL_FIELD_ACTION_MICRO_FLOW_POLICER,    /**< [D2.TM.TMM.TMA.AT] Micro Flow Policer; data0: Micro Policer Id, data1: Macro Policer Id*/
    CTC_ACL_FIELD_ACTION_MACRO_FLOW_POLICER,    /**< [D2.TM.TMM.AT] Macro Flow Policer; data0: Macro Policer Id */
    CTC_ACL_FIELD_ACTION_COS_HBWP_POLICER,      /**< [D2.TM.TMM.AT] HBWP Policer with cos index; data0: Policer Id; data1: cos index*/
    CTC_ACL_FIELD_ACTION_COPP,                  /**< [D2.TM.TMM.AT] Control Plane Policing(CoPP); data0: Policer Id */
    CTC_ACL_FIELD_ACTION_SRC_CID,               /**< [D2.TM.TMM.AT] Change Src category id; data0: New Src Category Id */
    CTC_ACL_FIELD_ACTION_TRUNCATED_LEN,         /**< [D2.TM.TMM.AT] The length of packet after truncate; data0: Length, if data0 highest bit set, mean truncate profile id*/
    CTC_ACL_FIELD_ACTION_REDIRECT,              /**< [D2.TM.TMM.AT] Redirect Packet; data0: Nexthop Id, data1: do not change Fwd Destination Port */
    CTC_ACL_FIELD_ACTION_REDIRECT_PORT,         /**< [D2.TM.TMM.TMA.AT] Redirect Packet to Single Port; data0: Assign Port
                                                                  TMA: data0, Port Bitmap, bit 0~28 means port; data1, linkagg bitmap bit 0~4 means linkagg group*/
    CTC_ACL_FIELD_ACTION_REDIRECT_CANCEL_PKT_EDIT, /**< [D2.TM.TMM.AT] Packet edit will be canceled for redirect packet*/
    CTC_ACL_FIELD_ACTION_REDIRECT_FILTER_ROUTED_PKT, /**<[D2.TM.TMM.AT] Filter Routed packet for redirect operation */

    CTC_ACL_FIELD_ACTION_DISCARD,               /**< [D2.TM.TMM.TMA.AT] Discard Packet; data0: color bitmap (ctc_qos_color_t); For CTC_ACL_KEY_INTERFACE,data0 must be CTC_QOS_COLOR_NONE, which means discarding red , green and yellow.*/
    CTC_ACL_FIELD_ACTION_CANCEL_DISCARD,        /**< [D2.TM.TMM.AT] Cancel Discard; data0 : color bitmap (ctc_qos_color_t) */
    CTC_ACL_FIELD_ACTION_PRIORITY,              /**< [D2.TM.TMM.AT] Change Priority; data0: color (ctc_qos_color_t); data1: New Priority */

    CTC_ACL_FIELD_ACTION_DISABLE_ELEPHANT_LOG,  /**< [D2.TM.TMM.AT] Disable Elephant Flow Log to cpu */
    CTC_ACL_FIELD_ACTION_TERMINATE_CID_HDR,     /**< [D2.TM.TMM.AT] Terminate Cid Header to Packet */
    CTC_ACL_FIELD_ACTION_CANCEL_NAT,            /**< [D2.TM.TMM.AT] Do Not perform NAT on this matching packet */

    CTC_ACL_FIELD_ACTION_IPFIX,                 /**< [D2.TM.TMM.AT] Enable Ipfix; ext_data: ctc_acl_ipfix_t */
    CTC_ACL_FIELD_ACTION_IPFIX_HASH_SALT,       /**< [AT] Enable Ipfix hash salt */
    CTC_ACL_FIELD_ACTION_CANCEL_IPFIX,          /**< [D2.TM.TMM.AT] Cancel Ipfix */
    CTC_ACL_FIELD_ACTION_CANCEL_IPFIX_LEARNING, /**< [D2.TM.TMM.AT] Cancel Ipfix Learning */

    CTC_ACL_FIELD_ACTION_OAM,                   /**< [D2.TM.TMM.AT] Enable OAM; ext_data: ctc_acl_oam_t */

    CTC_ACL_FIELD_ACTION_REPLACE_LB_HASH,       /**< [D2.TMM.AT] Replace ECMP/Linkagg Hash Value; ext_data: ctc_acl_lb_hash_t; data0: only valid for CTC_ACL_LB_HASH_MODE_ECMP, bit0 means ecmp level0, bit1 means ecmp level1, defautl 0 means two levels are enabled*/
    CTC_ACL_FIELD_ACTION_CANCEL_DOT1AE,          /**< [D2.TM.TMM.AT] Not encrypt packet on 802.1AE controlled ports */
	CTC_ACL_FIELD_ACTION_ECN,                    /**< replace packet ECN */
    CTC_ACL_FIELD_ACTION_DOT1AE_PERMIT_PLAIN_PKT,/**< [D2.TM.TMM.AT] Unencrypted Packet not discard on 802.1AE controlled ports */
    CTC_ACL_FIELD_ACTION_DOT1AE_CHAN_ID,        /**< [TMM] Dot1ae macsec channel, data0: Channel ID, ext_data: clear tag type, ref to ctc_dot1ae_clear_tag_type_t */
    CTC_ACL_FIELD_ACTION_DOT1AE_SPI,             /**< [AT] Security index to lookup the security chan as the key */

    CTC_ACL_FIELD_ACTION_METADATA,              /**< [D2.TM.TMM.AT] Metedata; data0: Metadata, if data0 equal to 0, means reset metdata */
    CTC_ACL_FIELD_ACTION_INTER_CN,              /**< [D2.TM.TMM.AT] Internal cn, indicate congestion class and state; ext_data: ctc_acl_inter_cn_t */

    CTC_ACL_FIELD_ACTION_VLAN_EDIT,             /**< [D2.TM.TMM.TMA.AT] Vlan Edit; ext_data: ctc_acl_vlan_edit_t */
    CTC_ACL_FIELD_ACTION_STRIP_PACKET,          /**< [D2.TM.TMM.AT] Used for Redirect Packet to Strip Packet Header ; ext_data: ctc_acl_packet_strip_t */

    CTC_ACL_FIELD_ACTION_CRITICAL_PKT,          /**< [D2.TM.TMM.AT] Critical Packet, data0: critical mode, 0 means critical packet, 1 means cancel critical packet */
    CTC_ACL_FIELD_ACTION_LOGIC_PORT,            /**< [D2.TM.TMM.AT] Logical port; */

    CTC_ACL_FIELD_ACTION_SPAN_FLOW,             /**< [D2.TM.TMM.AT] Indicate is span packet */
    CTC_ACL_FIELD_ACTION_CANCEL_ALL,            /**< [D2.TM.TMM.AT] Default Action:cancel all action; */
    CTC_ACL_FIELD_ACTION_QOS_TABLE_MAP,         /**< [D2.TM.TMM.TMA.AT] Qos table mapping; ext_data: ctc_acl_table_map_t */

    CTC_ACL_FIELD_ACTION_INT,                   /**< [TMM.AT] Enable INT and configure INT Node role*/
    CTC_ACL_FIELD_ACTION_IFA,                   /**< [TMM.AT] IFA Session ID*/
    CTC_ACL_FIELD_ACTION_SERVICE_ID,            /**< [TMM.AT] Service Id; data0: service id */
    CTC_ACL_FIELD_ACTION_NPM_IM_FLOW_ID,        /**< [TMM.AT] NPM In-Band Measurement Flow Id ; data0: Flow id */
    CTC_ACL_FIELD_ACTION_XDATA,                 /**< [AT] XData */

     /*only support in acl hash*/
    CTC_ACL_FIELD_ACTION_CANCEL_ACL_TCAM_EN,    /**< [D2.TM.TMM.AT] Cancel ACL Tcam Lookup; data0: ACL lookup level or ACL lookup level bitmap. data1: 1-enable ACL lookup level bitmap*/
    CTC_ACL_FIELD_ACTION_DENY_BRIDGE,           /**< [D2.TM.TMM.AT] Deny Bridge */
    CTC_ACL_FIELD_ACTION_DENY_LEARNING,         /**< [D2.TM.TMM.TMA.AT] Deny Learning */
    CTC_ACL_FIELD_ACTION_DENY_ROUTE,            /**< [D2.TM.TMM.AT] Deny Route */
    CTC_ACL_FIELD_ACTION_DEST_CID,              /**< [D2.TM.TMM.AT] Change Dest category id; data0: New Dest Category Id */

    CTC_ACL_FIELD_ACTION_LB_HASH_ECMP_PROFILE,  /**< [TM.TMM.AT] Select hash offset profile id for ecmp or packet head, data0: profile id */
    CTC_ACL_FIELD_ACTION_LB_HASH_LAG_PROFILE,   /**< [TM.TMM.AT] Select hash offset profile id for linkagg, data0: profile id */
    CTC_ACL_FIELD_ACTION_LB_HASH_PROFILE,       /**< [TM.TMM.AT] Replace of CTC_ACL_FIELD_ACTION_LB_HASH_ECMP_PROFILE and CTC_ACL_FIELD_ACTION_LB_HASH_LAG_PROFILE,
                                                                 ecmp and linkagg use same profile, data0: profile id */
    CTC_ACL_FIELD_ACTION_DISABLE_ECMP_RR,       /**< [TM.TMM.AT] Disable ecmp rr mode, data0: disable use 1 and enable use 0 */
    CTC_ACL_FIELD_ACTION_DISABLE_ECMP_DLB,      /**< [TMM.AT] Disable ecmp dlb mode, data0: disable use 1 and enable use 0 */
    CTC_ACL_FIELD_ACTION_DISABLE_LINKAGG_RR,    /**< [TM.TMM.AT] Disable linkagg rr mode, data0: disable use 1 and enable use 0 */
    CTC_ACL_FIELD_ACTION_VXLAN_RSV_EDIT,        /**< [TM] Vxlan reserved data edit mode, data0: merge use 0, clear use 1 and replace use 2 */
    CTC_ACL_FIELD_ACTION_TIMESTAMP,             /**< [TM.TMM.AT] Packet timestamp process, ext_data: refer to ctc_acl_timestamp_t */
    CTC_ACL_FIELD_ACTION_REFLECTIVE_BRIDGE_EN,  /**< [TM.TMM.AT] Enable input and output port is same when bridge, data0: 1-enable, 0-disable */
    CTC_ACL_FIELD_ACTION_PORT_ISOLATION_DIS,    /**< [TM.TMM.AT] Disable port isolation, data0: 1-disable, 0-enable */
    CTC_ACL_FIELD_ACTION_EXT_TIMESTAMP,         /**< [TM] Packet out with timerstamp and switch id, data0: 0-disable, 1-enable */
    CTC_ACL_FIELD_ACTION_CUT_THROUGH,           /**< [TM.TMM.AT] Cut through enable */
    CTC_ACL_FIELD_ACTION_FID,                   /**< [TM.TMM.AT] Forwarding Instance ID */
    CTC_ACL_FIELD_ACTION_SWAP_MAC,              /**< [TMA] Swap mac address */
    CTC_ACL_FIELD_ACTION_NSH,                   /**< [AT] Config NSH Node role, data0: NSH OP Type, ref to CTC_ACL_NSH_OP_TYPE_XXX, data1: NSH ID */
    CTC_ACL_FIELD_ACTION_QDROP_MONITOR,         /**< [AT] Monitoring span on drop */
    CTC_ACL_FIELD_ACTION_FPID,                  /**< [AT] Flex edit for ingress ACL */

    CTC_ACL_FIELD_ACTION_NUM
};
typedef enum ctc_acl_field_action_type_e ctc_acl_field_action_type_t;

/**
@brief Define ACL Ad Vxlan struct
*/
struct ctc_acl_vxlan_rsv_edit_s
{
    uint8   edit_mode;                  /**< [TM] Vxlan reserved data edit mode: 0-None, 1-Merge, 2-Clear and 3-Replace */
    uint8   vxlan_flags;                 /**< [TM] Vxlan flags */
    uint8   vxlan_rsv2;                  /**< [TM] Vxlan reserved2 */
    uint8   rsv;
    uint32  vxlan_rsv1;                 /**< [TM] Vxlan reserved1 */

};
typedef struct ctc_acl_vxlan_rsv_edit_s ctc_acl_vxlan_rsv_edit_t;

/**
@brief Define Acl Ad Time Stamp struct
*/
struct ctc_acl_timestamp_s
{
    uint8 mode;                           /**< [TM.TMM.AT] Time stamp process mode: 0-without time stamp, 1-with time stamp */
    uint8 rsv[3];
};
 typedef struct ctc_acl_timestamp_s ctc_acl_timestamp_t;

/**
@brief  ACL tcp field flag
*/
enum ctc_acl_tcp_flag_flag_e
{
    CTC_ACL_TCP_FIN_FLAG = 1U << 0, /**< [GB.GG] TCP fin flag */
    CTC_ACL_TCP_SYN_FLAG = 1U << 1, /**< [GB.GG] TCP syn flag */
    CTC_ACL_TCP_RST_FLAG = 1U << 2, /**< [GB.GG] TCP rst flag */
    CTC_ACL_TCP_PSH_FLAG = 1U << 3, /**< [GB.GG] TCP psh flag */
    CTC_ACL_TCP_ACK_FLAG = 1U << 4, /**< [GB.GG] TCP ack flag */
    CTC_ACL_TCP_URG_FLAG = 1U << 5  /**< [GB.GG] TCP urg flag */
};
typedef enum ctc_acl_tcp_flag_flag_e ctc_acl_tcp_flag_flag_t;

/**
@brief  Acl Pbr IPv6 Key Sub Flag
*/
enum ctc_acl_pbr_ipv6_key_sub_flag_e
{
    CTC_ACL_PBR_IPV6_KEY_SUB_FLAG_L4_SRC_PORT   = 1U << 0,  /**< [GB.GG] Depend on L4_PROTOCOL = TCP|UDP Valid L4 source port in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_SUB_FLAG_L4_DST_PORT   = 1U << 1,  /**< [GB.GG] Depend on L4_PROTOCOL = TCP|UDP Valid L4 destination port in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_SUB_FLAG_TCP_FLAGS     = 1U << 2,  /**< [GB.GG] Depend on L4_PROTOCOL = TCP.    Valid TCP flags in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_SUB_FLAG_ICMP_TYPE     = 1U << 3,  /**< [GB.GG] Depend on L4_PROTOCOL = ICMP.   Valid ICMP type in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_SUB_FLAG_ICMP_CODE     = 1U << 4   /**< [GB.GG] Depend on L4_PROTOCOL = ICMP.   Valid ICMP code in IPv6 key */
};
typedef enum ctc_acl_pbr_ipv6_key_sub_flag_e ctc_acl_pbr_ipv6_key_sub_flag_t;


/**
@brief  Define Log Percent
@remark The log percent varies due to the different pseudo-random sequence generation algorithms used by different chips.

        For GB, the log percent is (2^ctc_log_percent_t)/(2^15)
        For GG.D2.TM,TMM(acl) the log percent is (2^ctc_log_percent_t-1)/(2^15-1)
        For TMM(scl) the log percent is (2^ctc_log_percent_t)/(2^15-1)
        For example:
        | ctc_log_percent_t                 | GB            | GG/D2/TM/TMM(ACL)   | TMM(SCL)  |
        |-----------------------------------|---------------|---------------------|-----------|
        | CTC_LOG_PERCENT_POWER_NEGATIVE_14	| 2/32768	    | 1/32767             | 2/32767   |
        | CTC_LOG_PERCENT_POWER_NEGATIVE_13	| 4/32768	    | 3/32767             | 4/32767   |
        | CTC_LOG_PERCENT_POWER_NEGATIVE_12	| 8/32768	    | 7/32767             | 8/32767   |
        | CTC_LOG_PERCENT_POWER_NEGATIVE_11	| 16/32768	    | 15/32767            | 16/32767  |
*/
enum ctc_log_percent_e
{
    CTC_LOG_PERCENT_POWER_NEGATIVE_15,     /**< [GB] 2 (-15) */
    CTC_LOG_PERCENT_POWER_NEGATIVE_14,     /**< [GB.GG.D2.TM.TMM.AT] 2 (-14) */
    CTC_LOG_PERCENT_POWER_NEGATIVE_13,     /**< [GB.GG.D2.TM.TMM.AT] 2 (-13) */
    CTC_LOG_PERCENT_POWER_NEGATIVE_12,     /**< [GB.GG.D2.TM.TMM.AT] 2 (-12) */
    CTC_LOG_PERCENT_POWER_NEGATIVE_11,     /**< [GB.GG.D2.TM.TMM.AT] 2 (-11) */
    CTC_LOG_PERCENT_POWER_NEGATIVE_10,     /**< [GB.GG.D2.TM.TMM.AT] 2 (-10) */
    CTC_LOG_PERCENT_POWER_NEGATIVE_9,      /**< [GB.GG.D2.TM.TMM.AT] 2 (-9)  */
    CTC_LOG_PERCENT_POWER_NEGATIVE_8,      /**< [GB.GG.D2.TM.TMM.AT] 2 (-8)  */
    CTC_LOG_PERCENT_POWER_NEGATIVE_7,      /**< [GB.GG.D2.TM.TMM.AT] 2 (-7)  */
    CTC_LOG_PERCENT_POWER_NEGATIVE_6,      /**< [GB.GG.D2.TM.TMM.AT] 2 (-6)  */
    CTC_LOG_PERCENT_POWER_NEGATIVE_5,      /**< [GB.GG.D2.TM.TMM.AT] 2 (-5) : */
    CTC_LOG_PERCENT_POWER_NEGATIVE_4,      /**< [GB.GG.D2.TM.TMM.AT] 2 (-4) : 1/16*/
    CTC_LOG_PERCENT_POWER_NEGATIVE_3,      /**< [GB.GG.D2.TM.TMM.AT] 2 (-3) : 1/8 */
    CTC_LOG_PERCENT_POWER_NEGATIVE_2,      /**< [GB.GG.D2.TM.TMM.AT] 2 (-2) : 1/4   */
    CTC_LOG_PERCENT_POWER_NEGATIVE_1,      /**< [GB.GG.D2.TM.TMM.AT] 2 (-1) : 1/2   */
    CTC_LOG_PERCENT_POWER_NEGATIVE_0,      /**< [GB.GG.D2.TM.TMM.AT] 2 (0)  : 1/1  */
    CTC_LOG_PERCENT_MAX                    /**< [GB.GG.D2.TM.TMM.AT] max number  */
} ;
typedef enum ctc_log_percent_e ctc_log_percent_t;

/**
@brief Define ACl Query mode
*/
enum ctc_acl_query_mode_e
{
    CTC_ACL_QUERY_MODE_GROUPID,      /**< [GB.GG.D2.TM.TMM.AT] query by groupid*/
    CTC_ACL_QUERY_MODE_LKUP_LEVEL,   /**< [D2.TM.TMM.AT] query by lkup level*/
    CTC_ACL_QUERY_MODE_MAX
};
typedef enum ctc_acl_query_mode_e ctc_acl_query_mode_t;

/**
@brief Define ACl Query structure
*/
struct ctc_acl_query_s
{
    uint8   query_mode; /**< [D2.TM.TMM.AT] (in)     query mode, refer to ctc_acl_query_mode_t*/
    uint8   lkup_level; /**< [D2.TM.TMM.AT] (in)     ACL lkup level*/
    uint8   dir;        /**< [D2.TM.TMM.AT] (in)     direction*/
    uint32  group_id;   /**< [GB.GG.D2.TM.TMM.AT] (in)     ACL group ID*/
    uint32  entry_size; /**< [GB.GG.D2.TM.TMM.AT] (in)     The maximum number of entry IDs to return*/
    uint32* entry_array;/**< [GB.GG.D2.TM.TMM.AT] (in|out) A pointer to a memory buffer to hold the array of IDs*/
    uint32  entry_count;/**< [GB.GG.D2.TM.TMM.AT] (out)    Number of valid entries*/
    uint32  entry_num;  /**< [D2.TM.TMM.AT] (out)    Maximum number of entries in the special lkup level of smallest unit*/
    uint16  pp_bmp;     /**< [AT] Pipeline bitmap */
};
typedef struct ctc_acl_query_s ctc_acl_query_t;


/**
 @brief [GB] define acl vlan tag operation
*/

enum ctc_acl_vlan_tag_op_e
{
    CTC_ACL_VLAN_TAG_OP_NONE,        /**< [GB.GG.D2.TM.TMM.AT] do nothing*/
    CTC_ACL_VLAN_TAG_OP_REP,         /**< [GB.GG.D2.TM.TMM.AT] replace tag only for packet tagged*/
    CTC_ACL_VLAN_TAG_OP_ADD,         /**< [GB.GG.D2.TM.TMM.AT] append a new tag even if packet already has tag*/
    CTC_ACL_VLAN_TAG_OP_DEL,         /**< [GB.GG.D2.TM.TMM.AT] delete packet's tag only for packet tagged*/
    CTC_ACL_VLAN_TAG_OP_REP_OR_ADD,  /**< [GG.D2.TM.TMM.AT] replace for tagged, add for no stag */
    CTC_ACL_VLAN_TAG_OP_MAX
};
typedef enum ctc_acl_vlan_tag_op_e ctc_acl_vlan_tag_op_t;



/**
 @brief [GB] define acl vid or cos or cfi operation
*/

enum ctc_acl_vlan_tag_sl_e
{
    CTC_ACL_VLAN_TAG_SL_NONE,               /**< [GB.GG.D2.TM.TMM.TMA.AT] do nothing*/
    CTC_ACL_VLAN_TAG_SL_ALTERNATIVE  = 0x1, /**< [GB.GG.D2.TM.TMM.TMA.AT] select the other tag's vid/cos, if the other tag not present, use default*/
    CTC_ACL_VLAN_TAG_SL_NEW          = 0x2, /**< [GB.GG.D2.TM.TMM.TMA.AT] select user assigned vid/cos */
    CTC_ACL_VLAN_TAG_SL_MAP          = 0x3, /**< [D2.TM.TMM.AT] select mapped scos from QoS table map*/
    CTC_ACL_VLAN_TAG_SL_MAX
};
typedef enum ctc_acl_vlan_tag_sl_e ctc_acl_vlan_tag_sl_t;



/**
 @brief [GB] define acl vlan edit operation
*/
struct ctc_acl_vlan_edit_s
{
    uint8  stag_op;         /**< [GB.GG.D2.TM.TMM.AT] operation type of stag, see ctc_acl_vlan_tag_op_t  */
    uint8  svid_sl;         /**< [GB.GG.D2.TM.TMM.AT] select type of svid, see ctc_acl_vlan_tag_sl_t  */
    uint8  scos_sl;         /**< [GB.GG.D2.TM.TMM.TMA.AT] select type of scos, see ctc_acl_vlan_tag_sl_t  */
    uint8  scfi_sl;         /**< [GB.GG.D2.TM.TMM.AT] select type of scfi, see ctc_acl_vlan_tag_sl_t  */
    uint16 svid_new;        /**< [GB.GG.D2.TM.TMM.AT] new svid, valid only if svid_sl is CTC_ACL_VLAN_TAG_OP_REP/CTC_ACL_VLAN_TAG_OP_ADD*/
    uint8  scos_new;        /**< [GB.GG.D2.TM.TMM.TMA.AT] new scos, valid only if scos_sl is CTC_ACL_VLAN_TAG_OP_REP/CTC_ACL_VLAN_TAG_OP_ADD*/
    uint8  scfi_new;        /**< [GB.GG.D2.TM.TMM.TMA.AT] new scfi, valid only if scfi_sl is CTC_ACL_VLAN_TAG_OP_REP/CTC_ACL_VLAN_TAG_OP_ADD,for tma valid only if scos_sl is CTC_ACL_VLAN_TAG_OP_REP/CTC_ACL_VLAN_TAG_OP_ADD**/
    uint8  ctag_op;         /**< [GB.GG.D2.TM.TMM.AT] operation type of ctag, see ctc_acl_vlan_tag_op_t */
    uint8  cvid_sl;         /**< [GB.GG.D2.TM.TMM.AT] select type of cvid, see ctc_acl_vlan_tag_sl_t */
    uint8  ccos_sl;         /**< [GB.GG.D2.TM.TMM.AT] select type of ccos, see ctc_acl_vlan_tag_sl_t */
    uint8  ccfi_sl;         /**< [GB.GG.D2.TM.TMM.AT] select type of ccfi, see ctc_acl_vlan_tag_sl_t */
    uint16 cvid_new;        /**< [GB.GG.D2.TM.TMM.AT] new cvid, valid only if cvid_sl is CTC_ACL_VLAN_TAG_OP_REP/CTC_ACL_VLAN_TAG_OP_ADD*/
    uint8  ccos_new;        /**< [GB.GG.D2.TM.TMM.AT] new ccos, valid only if ccos_sl is CTC_ACL_VLAN_TAG_OP_REP/CTC_ACL_VLAN_TAG_OP_ADD*/
    uint8  ccfi_new;        /**< [GB.GG.D2.TM.TMM.AT] new ccfi, valid only if ccfi_sl is CTC_ACL_VLAN_TAG_OP_REP/CTC_ACL_VLAN_TAG_OP_ADD*/
    uint8  tpid_index;      /**< [GB.GG.D2.TM.TMM.AT] svlan tpid index, if set 0xff, tpid disable*/
};
typedef struct ctc_acl_vlan_edit_s ctc_acl_vlan_edit_t;

/**
 @brief [GG] define acl start packet strip
*/
enum ctc_acl_start_packet_strip_e
{
    CTC_ACL_STRIP_NONE,          /**< [GG] do nothing*/
    CTC_ACL_STRIP_START_TO_L2,   /**< [GG] Remove the start-of-packet up to the L2 header. */
    CTC_ACL_STRIP_START_TO_L3,   /**< [GG] Remove the start-of-packet up to the L3 header. */
    CTC_ACL_STRIP_START_TO_L4,   /**< [GG] Remove the start-of-packet up to the L4 header. */
    CTC_ACL_STRIP_MAX
};
typedef enum ctc_acl_start_packet_strip_e ctc_acl_start_packet_strip_t;

/**
 @brief [GG] define acl packet strip
*/
struct ctc_acl_packet_strip_s
{
    uint8  start_packet_strip;  /**< [GG.D2.TM.TMM.AT] strip start type. CTC_ACL_STRIP_START_TO_XX */
    uint8  packet_type;         /**< [GG.D2.TM.TMM.AT] payload packet type. PKT_TYPE_XXX */
    uint8  strip_extra_len;     /**< [GG.D2.TM.TMM.AT] strip extra length, unit: byte*/
    uint8  srv6_edit_en;        /**< [AT] enable srv6 edit */
};
typedef struct ctc_acl_packet_strip_s ctc_acl_packet_strip_t;

#include "common/include/ctc_acl_frz.h"

typedef struct ctc_acl_aset_s {
    uint8  aset_id;                                     /**< [TM.TMM.AT] in/out, aset index */
    uint8  type;                                        /**< [TM.TMM.AT] aset type, 0: igs-tcam, 1: egs-tcam, 2:flow-hah */
    uint8  xdata_prof_id;                                  /**< [AT] xdata profile id */
    uint32 w[CTC_B2W_SIZE(CTC_ACL_FIELD_ACTION_NUM)];   /**< [TM.TMM.AT] action bitmap */
} ctc_acl_aset_t;

/**
@brief  acl entry structure
*/
struct ctc_acl_entry_s
{
    ctc_acl_key_t key;              /**< [GB.GG.D2.TM] acl key struct mode. [D2.TM]only used when mode equal 0 for compatible mode*/
    ctc_acl_action_t action;        /**< [GB.GG.D2.TM] acl action struct*/
    ctc_acl_aset_t* aset;            /**< [TM.TMM.AT] action fields set>*/

    uint8  key_type;                /**< [D2.TM.TMM.TMA.AT] acl key type,refer to ctc_acl_key_type_t*/
    uint32 entry_id;                /**< [GB.GG.D2.TM.TMM.TMA.AT] acl action id*/
    uint8  priority_valid;          /**< [GB.GG.D2.TM.TMM.AT] acl entry priority valid. if not valid, use default priority*/
    uint32 priority;                /**< [GB.GG.D2.TM.TMM.AT] acl entry priority.*/
    uint8  hash_field_sel_id;       /**< [D2.TM.TMM.AT] Hash select ID,if set to 0 ,indicate all field are vaild */
    uint8  mode;                    /**< [D2.TM.TMM] 0, use sturct to install key and action; 1, use field to install key and action */
    uint16 pp_bmp;                  /**< [AT] Pipeline bitmap */
};
typedef struct ctc_acl_entry_s ctc_acl_entry_t;

/**
@brief  acl copy entry struct
*/
struct ctc_acl_copy_entry_s
{
    uint32 src_entry_id;  /**< [GB.GG.D2.TM.TMM.AT] ACL entry ID to copy from */
    uint32 dst_entry_id;  /**< [GB.GG.D2.TM.TMM.AT] New entry copied from src_entry_id */
    uint32 dst_group_id;  /**< [GB.GG.D2.TM.TMM.AT] Group ID new entry belongs */
};
typedef struct ctc_acl_copy_entry_s ctc_acl_copy_entry_t;

/**
@brief  acl hash IPv4 key flag
*/
enum ctc_acl_hash_ipv4_key_flag_e
{
    CTC_ACL_HASH_IPV4_KEY_FLAG_IP_DA            = 1U << 0, /**< [GB] IP DA as ACL IPV4 KEY member*/
    CTC_ACL_HASH_IPV4_KEY_FLAG_IP_SA            = 1U << 1, /**< [GB] IP SA as ACL IPV4 KEY member*/
    CTC_ACL_HASH_IPV4_KEY_FLAG_L4_SRC_PORT      = 1U << 2, /**< [GB] L4 source port as ACL IPV4 KEY member*/
    CTC_ACL_HASH_IPV4_KEY_FLAG_L4_DST_PORT      = 1U << 3, /**< [GB] L4 dest port as ACL IPV4 KEY member*/
    CTC_ACL_HASH_IPV4_KEY_FLAG_PHY_PORT         = 1U << 4, /**< [GB] Phy port as ACL IPV4 KEY member*/
    CTC_ACL_HASH_IPV4_KEY_FLAG_LOGIC_PORT       = 1U << 5, /**< [GB] Logic port as ACL IPV4 KEY member*/
    CTC_ACL_HASH_IPV4_KEY_FLAG_DSCP             = 1U << 6, /**< [GB] Dscp as ACL IPV4 KEY member*/
    CTC_ACL_HASH_IPV4_KEY_FLAG_L4_PROTOCOL      = 1U << 7, /**< [GB] L4 protocol as ACL IPV4 KEY member*/
    CTC_ACL_HASH_IPV4_KEY_FLAG_ARP_PACKET       = 1U << 8, /**< [GB] Arp packet as ACL IPV4 KEY member*/
    CTC_ACL_HASH_IPV4_KEY_FLAG_MAX              = 1U << 9
};
typedef enum ctc_acl_hash_ipv4_key_flag_e ctc_acl_hash_ipv4_key_flag_t;

/**
@brief  acl upa enable mode
*/
enum ctc_acl_upa_mode_e
{
    CTC_ACL_UPA_DISABLE = 0,        /**< [D2.TM.TMM.AT] Disable upa mode*/
    CTC_ACL_UPA_BOTH_EN = 1,        /**< [D2.TM.TMM.AT] Enable upa mode for ingress direction and egress direction*/
    CTC_ACL_UPA_IGS_EN  = 2,        /**< [D2.TM.TMM.AT] Enable upa mode for ingress direction*/
    CTC_ACL_UPA_EGS_EN  = 3         /**< [D2.TM.TMM.AT] Enable upa mode for egress direction*/
};
typedef enum ctc_acl_upa_mode_e ctc_acl_upa_mode_t;

/**
@brief  acl global config structure
*/
struct ctc_acl_global_cfg_s
{
    uint8  merge_mac_ip;                 /**< [GB] If merged, l2 packets and ipv4 packets will all go ipv4-entry. In this case, mac-entry will never hit. (default: 0)*/
    uint8  ingress_use_mapped_vlan;      /**< [GB] Ingress acl use mapped vlan instead of packet vlan  (default: 0)*/

    uint8  trill_use_ipv6;               /**< [GB] trill packet use ipv6 key (default: 0)*/
    uint8  arp_use_ipv6;                 /**< [GB] arp packet use ipv6 key (default: 0)*/
    uint8  non_ipv4_mpls_use_ipv6;       /**< [GB] non ipv4 or mpls packet use ipv6 key (default: 0)*/
    uint8  hash_acl_en;                  /**< [GB] enable hash acl (default: 1)*/
    uint32  priority_bitmap_of_stats;    /**< [GB] bitmap of priority to support stats. Only support 2 stats of 4 priority. Bigger than 2, the high priority will take effect. (default: 0)*/

    uint8  ingress_port_service_acl_en;  /**< [GB.GG] ingress service acl enable on port (default: 1)*/
    uint8  ingress_vlan_service_acl_en;  /**< [GB.GG] ingress service acl enable on vlan (default: 1)*/
    uint8  egress_port_service_acl_en;   /**< [GB.GG] egress service acl enable on port (default: 1)*/
    uint8  egress_vlan_service_acl_en;   /**< [GB.GG] egress service acl enable on vlan (default: 1)*/

    uint32 hash_ipv4_key_flag;           /**< [GB] hash ipv4 key flag (default: 0)*/
    uint32 hash_mac_key_flag;            /**< [GB] hash mac key flag (default: 0)*/

    uint8  white_list_en;                /**< [GB] acl white list enable (default: 0)*/
    uint8  upa_en;                       /**< [TM.TMM.AT] Refer to ctc_acl_upa_mode_t, if user priority arragment(UPA) enable, tcam index is assigned by user and the entry priority is used as tcam index.*/
    uint8  udf_fpa_en;                   /**< [TMM.AT] If set, the hardware index of udf entry is assigned by the FPA algorithm according to priority.*/
};
typedef struct ctc_acl_global_cfg_s ctc_acl_global_cfg_t;

/**
@brief  acl group type
*/
enum ctc_acl_group_type_e
{
    CTC_ACL_GROUP_TYPE_NONE,         /**< [GB.GG.D2.TM.TMM.AT] default type, care port info by entry*/
    CTC_ACL_GROUP_TYPE_HASH,         /**< [GB.GG.D2.TM.TMM.AT] Hash group */
    CTC_ACL_GROUP_TYPE_PORT_BITMAP,  /**< [GB.GG.D2.TM.TMM.AT] Port bitmap */
    CTC_ACL_GROUP_TYPE_GLOBAL,       /**< [GB.GG.D2.TM.TMM.AT] Global acl, mask ports and vlans */
    CTC_ACL_GROUP_TYPE_VLAN_CLASS,   /**< [GB.GG.D2.TM.TMM.AT] A vlan class acl is against a class(group) of vlan*/
    CTC_ACL_GROUP_TYPE_PORT_CLASS,   /**< [GB.GG.D2.TM.TMM.AT] A port class acl is against a class(group) of port*/
    CTC_ACL_GROUP_TYPE_SERVICE_ACL,  /**< [GB.GG.D2.TM.TMM.AT] A service acl is against a service*/
    CTC_ACL_GROUP_TYPE_L3IF_CLASS,   /**< [D2.TM.TMM.AT] A l3if class acl is against a class(group) of l3if*/
    CTC_ACL_GROUP_TYPE_PBR_CLASS,    /**< [GB.GG.D2.TM.TMM.AT] A pbr class is against a class(group) of l3 source interface*/
    CTC_ACL_GROUP_TYPE_PORT,         /**< [GG.D2.TM.TMM.AT] Port acl, care gport. */
    CTC_ACL_GROUP_TYPE_MAX
};
typedef enum ctc_acl_group_type_e ctc_acl_group_type_t;

#define CTC_ACL_FLEX_KEY_PRESEL_NUM 4
#define CTC_ACL_UDF_CHUNK_NUM       16

/* Field kset defines the set of fields used for lookup. */
typedef struct ctc_acl_kset_s {
    uint32 w[CTC_B2W_SIZE(CTC_FIELD_KEY_NUM)];/*kset words*/
    uint32 udf_w[CTC_B2W_SIZE(CTC_ACL_UDF_CHUNK_NUM)];
} ctc_acl_kset_t;


#define CTC_ACL_KSET_INIT(kset)  \
    sal_memset(&(kset), 0, sizeof(ctc_acl_kset_t))

#define CTC_ACL_KSET_ADD(kset, field)  CTC_BMP_SET(((kset).w), (field))
#define CTC_ACL_KSET_REMOVE(kset, field)  CTC_BMP_UNSET(((kset).w), (field))
#define CTC_ACL_KSET_ISSET(kset, field)  CTC_BMP_ISSET(((kset).w), (field))








enum ctc_acl_key_size_e
{
    CTC_ACL_KEY_SIZE_NONE,          /**< [D2.TM.TMM.AT] None key size*/
    CTC_ACL_KEY_SIZE_160,           /**< [D2.TM.TMM.AT] 160 bits key size*/
    CTC_ACL_KEY_SIZE_320,           /**< [D2.TM.TMM.AT] 320 bits key size*/
    CTC_ACL_KEY_SIZE_480,           /**< [D2.TM.TMM.AT] 480 bits key size*/
    CTC_ACL_KEY_SIZE_640,           /**< [D2.TM.TMM] 640 bits key size*/
};
typedef enum ctc_acl_key_size_e ctc_acl_key_size_t;

/**
@brief  acl group info,  NOT For hash group
*/
struct ctc_acl_group_info_s
{
    uint8 type;                      /**< [GB.GG.D2.TM.TMM.AT] install_group ignore this, ctc_acl_group_type_t */
    uint8 lchip;                     /**< [GB.GG.D2.TM.TMM] Local device id, only for type= PORT_BITMAP, Other type ignore it*/
    uint8 priority;                  /**< [GB.GG.D2.TM.TMM.AT] Alias is lookup level, which means the lookup level of the entry in this group*/

    uint8 key_size;                  /**< [D2.TM] All entrys in this group occupy the same key size otherwise decide according to key type,refer to ctc_acl_key_size_t*/
    ctc_direction_t dir;             /**< [GB.GG.D2.TM.TMM.AT] diretion. Pbr ignore it*/
    ctc_acl_aset_t* aset;            /**< [TMM.AT] action fields set>*/

    union
    {
        ctc_port_bitmap_t port_bitmap;/**< [GB.GG.D2.TM.TMM.AT] In GB, mpls key only support 52 bits, mac/ipv4/ipv6 key support 56 bits */
        uint16 port_class_id;         /**< [GB.GG.D2.TM.TMM.AT] port class id, multiple ports can share same port_class_id */
        uint16 vlan_class_id;         /**< [GB.GG.D2.TM.TMM.AT] vlan class id, multiple vlans can share same vlan_class_id */
        uint16 l3if_class_id;         /**< [D2.TM.TMM.AT] l3if class id, multiple l3 interface can share same l3if_class_id */
        uint16 service_id;            /**< [GB.GG.D2.TM.TMM.AT] service id  */
        uint8  pbr_class_id;          /**< [GB.GG.D2.TM.TMM.AT] pbr class id */
        uint32 gport;                 /**< [GG.D2.TM.TMM.AT] gport */
    } un;
};
typedef struct ctc_acl_group_info_s ctc_acl_group_info_t;

enum ctc_acl_flex_key_flag_e
{
    CTC_ACL_FLEX_FLAG_PBM_NO_GPORT    = 1U << 0,  /**< [TMM.AT] port_bitmap format mode without gport, only valid port_bitmap_width is set */
    CTC_ACL_FLEX_KEY_FLAG_HASH        = 1U << 1,  /**< [AT] if set, it means hash flex key */
    CTC_ACL_FLEX_KEY_FLAG_LKUP_TYPE   = 1U << 2   /**< [AT] if set, lookup type is valid */
};
typedef enum ctc_acl_flex_key_flag_e ctc_acl_flex_key_flag_t;

/**
@brief  acl flex key structure
*/
struct ctc_acl_flex_key_s
{
    uint32 flag;                /**< [TMM.AT] refer to ctc_acl_flex_key_flag_t */
    uint8  mode;                 /**< [AT] hash key mode, only valid if origin_key_type exist, ref to ctc_field_flex_key_mode_t */
    uint8  key_type;            /**< [D2.TM.TMM.AT] acl key type, refer to ctc_acl_key_type_t */

    uint8  dir;                 /**< [D2.TM.TMM.AT] direction, refer to ctc_direction_t */
    uint8  origin_key_type;     /**< [D2.TM.TMM.AT] origin key type, only valid if non-flex key(such as CTC_ACL_KEY_MAC, CTC_ACL_KEY_IPV4 ...) use kset */
    uint8  l3_type;             /**< [D2.TM.TMM.AT] layer3 type, only valid if non-flex key(such as CTC_ACL_KEY_MAC, CTC_ACL_KEY_IPV4 ...) use kset */
    uint8  l4_type;             /**< [D2.TM.TMM.AT] layer4 type, only valid if non-flex key(such as CTC_ACL_KEY_MAC, CTC_ACL_KEY_IPV4 ...) use kset */
    uint8  l4_user_type;        /**< [D2.TM.TMM.AT] layer4 user type, only valid if non-flex key(such as CTC_ACL_KEY_MAC, CTC_ACL_KEY_IPV4 ...) use kset */
    uint16 ether_type;          /**< [D2.TM.TMM.AT] ether type, only valid if non-flex key(such as CTC_ACL_KEY_MAC, CTC_ACL_KEY_IPV4 ...) use kset */
    ctc_acl_kset_t kset;        /**< [D2.TM.TMM.AT] acl flex key fields*/

    uint8  size;                /**< [TMM.AT] acl key size, refer to ctc_acl_key_size_t */
    uint8  compress_ether_type; /**< [TMM.AT] if set, use compress ether type */
    uint8  ipv6_da_bmp;         /**< [TMM.AT] ipv6 da bitmap(in word) */
    uint8  ipv6_sa_bmp;         /**< [TMM.AT] ipv6 sa bitmap(in word) */
    uint16 udf_bmp;             /**< [TMM.AT] udf bitmap(in half word) */
    uint16 sudf_bmp;            /**< [TMM.AT] service udf bitmap(in half word) */
    uint8  port_bitmap_width;   /**< [TMM.AT] port_bitmap format mode, refer to ctc_acl_port_bitmap_width_t */
    uint8  lkup_type;           /**< [AT] acl lookup type, ref to ctc_acl_tcam_lkup_type_t */
    ctc_xdata_t xdata;          /**< [AT] for tcam key, xdata; for hash key, local xdata; only valid for CTC_FIELD_KEY_XDATA */
};
typedef struct ctc_acl_flex_key_s ctc_acl_flex_key_t;

/**
@brief port bitmap mode
*/
enum ctc_acl_port_bitmap_width_e
{
    CTC_ACL_PORT_BITMAP_WIDTH_16,      /**< [TMM.AT] port bitmap use 16bit width */
    CTC_ACL_PORT_BITMAP_WIDTH_16_2,    /**< [TMM.AT] port bitmap use 16bit width, not share with gport */
    CTC_ACL_PORT_BITMAP_WIDTH_32,      /**< [TMM.AT] port bitmap use 32bit width */
    CTC_ACL_PORT_BITMAP_WIDTH_64,      /**< [TMM.AT] port bitmap use 64bit width */
    CTC_ACL_PORT_BITMAP_WIDTH_128,     /**< [TMM.AT] port bitmap use 128bit width */
    CTC_ACL_PORT_BITMAP_WIDTH_256,     /**< [TMM.AT] port bitmap use 256bit width */
    CTC_ACL_PORT_BITMAP_WIDTH_MAX
};
typedef enum ctc_acl_port_bitmap_width_e ctc_acl_port_bitmap_width_t;


/**
@brief acl presel flag
*/
enum ctc_acl_presel_flag_e
{
    CTC_ACL_PRESEL_FLAG_LKUP_LEVEL      = 1U << 0,  /**< [TMM.AT] Lkup level of presel entry is valid */
    CTC_ACL_PRESEL_FLAG_ENTRY_PRIO      = 1U << 1,  /**< [TMM.AT] Priority of presel entry is valid */
    CTC_ACL_PRESEL_FLAG_MAX
};
typedef enum ctc_acl_presel_flag_e ctc_acl_presel_flag_t;

/**
@brief acl presel structure
*/
struct ctc_acl_presel_s
{
    uint32 flag;        /**< [TMM.AT] acl presel flag, refer to ctc_acl_presel_flag_t */
    uint16 presel_id;   /**< [TMM.AT] acl presel id */
    uint8  lkup_level;  /**< [TMM.AT] acl lookup level */
    uint8  dir;         /**< [AT] direction, refer to ctc_direction_t */
    uint32 entry_pri;   /**< [TMM.AT] presel entry priority */

    uint8  key_type;    /**< [TMM.AT] acl key type, refer to ctc_acl_key_type_t */
};
typedef struct ctc_acl_presel_s ctc_acl_presel_t;

/**
@brief  acl cid pair flag
*/
enum ctc_acl_cid_pair_flag_e
{
    CTC_ACL_CID_PAIR_FLAG_FLEX            = 1U << 0,   /**< [D2.TM.TMM.AT] CategoryId Pair use tcam, can use to solve hash conflict. */
    CTC_ACL_CID_PAIR_FLAG_SRC_CID         = 1U << 1,   /**< [D2.TM.TMM.AT] src category id as cid pair member. */
    CTC_ACL_CID_PAIR_FLAG_DST_CID         = 1U << 2,   /**< [D2.TM.TMM.AT] dst category id as cid pair member. */
    CTC_ACL_CID_APIR_FLAG_MAX
};
typedef enum ctc_acl_cid_pair_flag_e ctc_acl_cid_pair_flag_t;

/**
@brief  acl cid pair action flag
*/
enum ctc_acl_cid_pair_action_e
{
    CTC_ACL_CID_PAIR_ACTION_PERMIT,             /**< [D2.TM.TMM.AT] Permit packet. */
    CTC_ACL_CID_PAIR_ACTION_DISCARD,            /**< [D2.TM.TMM.AT] Discard packet. */
    CTC_ACL_CID_PAIR_ACTION_OVERWRITE_ACL,      /**< [D2.TM.TMM.AT] Overwrite tcam acl. */
    CTC_ACL_CID_PAIR_ACTION_MAX
};
typedef enum ctc_acl_cid_pair_action_e ctc_acl_cid_pair_action_t;

/**
@brief  define acl cid pair structure
*/
struct ctc_acl_cid_pair_s
{
    uint32  flag;                       /**< [D2.TM.TMM.AT] Category Id pair flag, ctc_acl_cid_pair_flag_t. */

    uint16  src_cid;                    /**< [D2.TM.TMM.AT] src category id. */
    uint16  dst_cid;                    /**< [D2.TM.TMM.AT] dst category id. */

    uint8   action_mode;                /**< [D2.TM.TMM.AT] cid pair action mode, ctc_acl_cid_pair_action_t. */
    ctc_acl_property_t acl_prop;        /**< [D2.TM.TMM.AT] overwrite acl property. */

    uint16 pp_bmp;                     /**< [AT] pipeline bitmap */
};
typedef struct ctc_acl_cid_pair_s ctc_acl_cid_pair_t;

/**
@brief  define acl oam structure
*/
/**
@brief  acl oam type
*/
enum ctc_acl_oam_type_e
{
    CTC_ACL_OAM_TYPE_ETH_OAM = 1,    /**< [D2.TM.TMM.AT] Oam type is Ether Oam. */
    CTC_ACL_OAM_TYPE_IP_BFD = 2,     /**< [D2.TM.TMM.AT] Oam type is IP BFD. */
    CTC_ACL_OAM_TYPE_TWAMP = 11,     /**< [D2.TM.TMM.AT] Oam type is TWAMP. */
    CTC_ACL_OAM_TYPE_FLEX = 12,      /**< [D2.TM.TMM.AT] Oam type is FLEX. */
    CTC_ACL_OAM_TYPE_MAX
};
typedef enum ctc_acl_oam_type_e  ctc_acl_oam_type_t;

struct ctc_acl_oam_s
{
   uint8 dest_gchip;       /**< [D2.TM.TMM] Global Chip Id. */
   uint8 oam_type;         /**< [D2.TM.TMM] Oam Type, refer to ctc_acl_oam_type_t . */
   uint16 lmep_index;      /**< [D2.TM.TMM] Local Mep index . */

   uint8 mip_en;           /**< [D2.TM.TMM] Mip enable . */
   uint8 link_oam_en;      /**< [D2.TM.TMM] Link Oam or Section Oam . */
   uint8 packet_offset;    /**< [D2.TM.TMM] used for bfd and twamp */
   uint8 mac_da_check_en;  /**< [D2.TM] Mac da check enable*/

   uint8 is_self_address;  /**< [D2.TM] Indicate that mac address is switch's*/
   uint8 time_stamp_en;    /**< [D2.TM.TMM.AT] Time stamp enable*/
   uint8 timestamp_format; /**< [TM.TMM.AT] Timestamp format (0: PTPv2, 1:NTP) */
   uint8 twamp_reflect_en; /**< [TMM.AT] if set, indicate Session-reflecter receive Twamp message */
   uint8 gal_exist;        /**< [TMM.AT] Generic associated channel label exist */
};
typedef struct  ctc_acl_oam_s ctc_acl_oam_t;

/**
@brief  Only used for CTC_FIELD_KEY_AWARE_TUNNEL_INFO
*/
struct ctc_acl_tunnel_data_s
{
   uint8 type;                               /**< [D2.TM.TMM.AT] 0:none; 1: Vxlan; 2: Gre; 3:Wlan*/
   uint8 rsv[3];
   uint32 vxlan_vni;                         /**< [D2.TM.TMM.AT] Merge Key. Vxlan vni*/
   uint32 gre_key;                           /**< [D2.TM.TMM.AT] Merge Key. Gre key*/
   mac_addr_t radio_mac;                     /**< [D2.TM.TMM.AT] Merge Key. Wlan info: Radio Mac*/
   uint8 radio_id;                           /**< [D2.TM.TMM.AT] Merge Key. Wlan info: Radio ID*/
   uint8 wlan_ctl_pkt;                       /**< [D2.TM.TMM.AT] Merge Key. Wlan info: Wlan Ctl Pkt*/
};
typedef struct  ctc_acl_tunnel_data_s ctc_acl_tunnel_data_t;

enum ctc_acl_to_cpu_mode_e
{
    CTC_ACL_TO_CPU_MODE_TO_CPU_NOT_COVER,   /**< [D2.TM.TMM.TMA.AT] Cover switch logic copy-to-CPU,if switch logic don't copy-to-CPU,the rules enable copy-to-CPU with CTC_PKT_CPU_REASON_ACL_MATCH */
    CTC_ACL_TO_CPU_MODE_TO_CPU_COVER,       /**< [D2.TM.TMM.TMA.AT] Cover switch logic copy-to-CPU,re-assign cpu reason */
    CTC_ACL_TO_CPU_MODE_CANCEL_TO_CPU,      /**< [D2.TM.TMM.AT] Cancel switch logic copy-to-CPU */
    CTC_ACL_TO_CPU_MODE_MAX
};
typedef enum ctc_acl_to_cpu_mode_e ctc_acl_to_cpu_mode_t;


struct ctc_acl_to_cpu_s
{
    uint16  mode;                          /**< [D2.TM.TMM.TMA.AT] CTC_ACL_TO_CPU_MODE_XXX, refer to ctc_acl_to_cpu_mode_t */
    uint16  cpu_reason_id;                 /**< [D2.TM.TMM.TMA.AT] just for CTC_ACL_TO_CPU_MODE_TO_CPU_COVER,only support normal exception or user-define cpu_reason */
    uint8   color;                         /**< [TMM.AT] color bitmap (ctc_qos_color_t) */
};
typedef struct ctc_acl_to_cpu_s ctc_acl_to_cpu_t;

enum ctc_acl_lb_hash_mode_e
{
    CTC_ACL_LB_HASH_MODE_LINKAGG,       /**< [D2.TMM.AT] Linkagg Hash */
    CTC_ACL_LB_HASH_MODE_ECMP,          /**< [D2.TMM.AT] ECMP Hash */
    CTC_ACL_LB_HASH_MODE_SHARE,         /**< [D2] Linkagg and ECMP Hash use same value */
    CTC_ACL_LB_HASH_MODE_STACKING       /**< [TMM.AT] Stacking Hash */
};
typedef enum ctc_acl_lb_hash_mode_e ctc_acl_lb_hash_mode_t;

struct ctc_acl_lb_hash_s
{
    uint8  mode;                 /**< [D2.TMM.AT] LoadBalance Hash mode, refer to ctc_acl_lb_hash_mode_t */
    uint8  lb_hash;              /**< [D2.TMM.AT] LoadBalance Hash value */
};
typedef struct ctc_acl_lb_hash_s ctc_acl_lb_hash_t;

struct ctc_acl_ipfix_s
{
    uint8  flow_cfg_id;              /**< [D2.TM.TMM.AT] ipfix cfg profile id */
    uint8  field_sel_id;             /**< [D2.TM.TMM.AT] ipfix hash field select id */
    uint8  hash_type;                /**< [D2.TM.TMM.AT] ipfix hash key type, refer to ctc_ipfix_lkup_type_t */
    uint8  use_mapped_vlan;          /**< [D2.TM.TMM.AT] ipfix use mapped vlan */

    uint8  use_cvlan;                /**< [D2.TM] ipfix use cvlan */
    uint8  lantency_en;              /**< [TM.TMM.AT] enable ipfix measure lantency only for egress */
    uint8  cancel_learning;          /**< [AT] cancel ipfix learning */
    uint8  sudf_en;                   /**< [AT] if set, indicate service udf, only valid for scl, mpls or tunnel*/

    uint32 policer_id;               /**< [TM.TMM] ipfix MFP policer id*/

    uint8  flex_key_en;              /**< [AT] ipfix flex key enable*/
};
typedef struct ctc_acl_ipfix_s ctc_acl_ipfix_t;

struct ctc_acl_udf_s
{
    uint32  udf_id;                       /**< [D2.TM.TMM.TMA.AT] UDF ID*/
    uint8   udf[CTC_ACL_UDF_BYTE_NUM];    /**< [D2.TM.TMM.TMA.AT] The offset of each UDF field*/

    uint8   sel_id;   /**< [TMM.AT] UDF sel id <0-7>, used for select 16bits UDF, 0->[0:15], 1->[16:31], and so on*/
    uint16  mask;     /**< [TMM.AT] UDF sel data mask*/
    uint16  min;      /**< [TMM.AT] UDF Range Min value*/
    uint16  max;      /**< [TMM.AT] UDF Range Max value*/
    uint16  udf_ad_id; /**< [D2.TM.TMM.AT] Hardware action id of shared UDF*/
};
typedef struct ctc_acl_udf_s ctc_acl_udf_t;

enum ctc_acl_udf_offset_type_e
{
    CTC_ACL_UDF_TYPE_NONE,        /* for campitible with D2 */
    CTC_ACL_UDF_OFFSET_L2,        /**< [D2.TM.TMM.TMA.AT] start of L2 header*/
    CTC_ACL_UDF_OFFSET_L3,        /**< [D2.TM.TMM.TMA.AT] start of L3 header*/
    CTC_ACL_UDF_OFFSET_L4,        /**< [D2.TM.TMM.TMA.AT] start of L4 header*/
    CTC_ACL_UDF_OFFSET_INNER_L2,  /**< [TMM.AT] start of inner L2 header*/
    CTC_ACL_UDF_OFFSET_INNER_L3,  /**< [TMM.AT] start of inner L3 header*/
    CTC_ACL_UDF_OFFSET_INNER_L4,  /**< [TMM.AT] start of inner L4 header*/
    CTC_ACL_UDF_TYPE_NUM
};
typedef enum ctc_acl_udf_offset_type_e ctc_acl_udf_offset_type_t;

/*
 SUDF means SCL, MPLS or TUNNEL used as UDF lkup to extract fields from packet.
  --------          udf id        ----------  256bit      -----------
 | Parser | ---- ----------- --> | UDF DATA | ---------> | ACL/IPFIX |
  --------      | OverWrite |     ----------              -----------
      |          -----------
      |                A
  ----------           |
 | UDF DATA |          |
  ----------           |
      |128bit          |
      |                |
   scl_key             |
      |                |
      |                |
      V                |
  --------             |
 | SCL    | ----------- sudf id
  --------             |
                       |
  --------             |
 | MPLS   | -----------
  --------             |
                       |
  --------             |
 | TUNNEL | -----------
  --------
 */
 /**
@brief  acl classify udf flag
*/
enum ctc_acl_classify_udf_flag_e
{
    CTC_ACL_CLASSIFY_UDF_ACL_XDATA = 1U << 0,             /**< [AT] if set, acl can use udfdata to producing xdata. */
};
typedef enum ctc_acl_classify_udf_flag_e ctc_acl_classify_udf_flag_t;

/**
@brief  acl entry structure
*/
struct ctc_acl_classify_udf_s
{
   uint32  flag;                                        /**< [AT] Classify udf flag, ctc_acl_classify_udf_flag_t. */
   uint32 udf_id;                                       /**< [D2.TM.TMM.TMA.AT] UDF ID*/
   uint16 priority;                                     /**< [D2.TM.TMM.AT] entry priority of UDF entry*/
   uint16 udf_ad_id;                                    /**< [D2.TM.TMM.AT] if shared_udf set, user assign UDF ACTION ID, else, return inner allocated UDF ACTION ID*/
   uint8  query_type;                                   /**< [D2.TM.TMM.AT] 0-by UDF ID;1-By priority*/
   uint8  tcp_option_en;                                /**< [D2.TM.TMM.AT] if set, indicate macth packet is TCP and TCP option enable */
   uint8  skip_vlan;                                    /**< [TMM.AT] if set, indicate skip vlan tag when offset_type is L2*/
   uint8  offset_type;                                  /**< [D2.TM.TMM.TMA.AT] refer to ctc_acl_udf_offset_type_t*/
   uint8  offset_num;                                   /**< [D2.TM.TMM.TMA.AT] The number of UDF field*/
   uint8  offset_type_array[CTC_ACL_UDF_FIELD_NUM];     /**< [TM.TMM.TMA.AT]  refer to ctc_acl_udf_offset_type_t*/
   uint8  offset[CTC_ACL_UDF_FIELD_NUM];                /**< [D2.TM.TMM.TMA.AT] The offset of each UDF field*/
   uint8  mask[CTC_ACL_UDF_BYTE_NUM];                   /**< [TMM.AT] UDF Mask, which can mask the data extracted by udf action*/
   uint8  valid;                                        /**< [D2.TM.TMM.TMA.AT] indicate the UDF entry have installed to HW and key is FULL, used to get udf entry*/
   uint8  granularity;                                  /**< [TMM.AT] 0: extract 4 byte from one offset; 1: extract 2 byte from one offset */
   uint8  sudf_en;                                      /**< [TMM.AT] if set, indicate service udf, only valid for scl, mpls or tunnel */
   uint8  shared_udf;                                   /**< [D2.TM.TMM.AT] if set, indicate share udf, use udf_ad_id */
   uint8  ipfix_en;                                     /**< [TMM] if set, indicate enable udf ipfix*/
   struct ctc_acl_classify_udf_s* scl_key;              /**< [TMM.AT] if set, indicate udf entry is used for scl key, only valid when sudf_en unset*/

   uint16  pp_bmp;                                       /**< [AT] Pipeline bitmap */
};
typedef struct ctc_acl_classify_udf_s ctc_acl_classify_udf_t;

struct ctc_acl_inter_cn_s
{
    uint8  inter_cn;           /**< [D2.TM.TMM.AT] Internal cn, pls refer to ctc_qos_inter_cn_t */
    uint8  color;              /**< [TMM.AT] color bitmap, refer to ctc_qos_color_t(none means no input) */
    uint8  rsv[2];
};
typedef struct ctc_acl_inter_cn_s ctc_acl_inter_cn_t;

struct ctc_acl_table_map_s
{
    uint8  table_map_id;                   /**< [D2.TM.TMM.TMA.AT] Table map id */
    uint8  table_map_type;                 /**< [D2.TM.TMM.TMA.AT] Table mapping type, refer to ctc_qos_table_map_type_t, for TMA: 0-trust scos, 1- trust dscp */
    uint16 rsv;
};
typedef struct ctc_acl_table_map_s ctc_acl_table_map_t;


struct ctc_acl_int_s
{
    uint8    session_type;              /**< [TMM.AT] INT node type , ctc_dtel_int_session_type_t */
    uint16   instruction_bitmap;        /**< [TMM.AT] Instruction_bitmap on the Source INT Node, refer to ctc_dtel_int_ins_bitmap_t */
    uint16   session_id;                /**< [TMM.AT] Session ID on the Sink INT Node  */
};
typedef struct ctc_acl_int_s ctc_acl_int_t;
struct ctc_acl_log_s
{
    uint8  log_id;                     /**< [TMM.AT] Acl log id <0-7>*/
    uint8  session_id;                 /**< [TMM.AT] Log session id <0-3> */
    ctc_log_percent_t percent;         /**< [TMM.AT] Log percent*/
};
typedef struct ctc_acl_log_s ctc_acl_log_t;

struct ctc_acl_field_action_s
{
    uint16 type;                    /**< [D2.TM.TMM.TMA.AT] Action Field type, refer to ctc_acl_field_action_type_t */

    uint32 data0;                   /**< [D2.TM.TMM.TMA.AT] Action Field data0 (uint32) */
    uint32 data1;                   /**< [D2.TM.TMM.TMA.AT] Action Field data1 (uint32) */
    void*  ext_data;                /**< [D2.TM.TMM.TMA.AT] Action Field extend data (void*) */
};
typedef struct ctc_acl_field_action_s ctc_acl_field_action_t;

struct ctc_acl_cid_pri_s
{
    uint8   dir;                    /**< [D2.TM.TMM.AT] Direction */
    uint8   default_cid_pri;        /**< [D2.TM.TMM.AT] Priority of default Category ID */
    uint8   fwd_table_cid_pri;      /**< [D2.TM.TMM.AT] Priority of Forward Category ID */
    uint8   flow_table_cid_pri;     /**< [D2.TM.TMM.AT] Priority of Flow Category ID */
    uint8   global_cid_pri;         /**< [D2.TM.TMM.AT] Priority of Global Category ID */
    uint8   pkt_cid_pri;            /**< [D2.TM.TMM.AT] Priority of Packet Category ID */
    uint8   if_cid_pri;             /**< [D2.TM.TMM.AT] Priority of L3if Category ID */
    uint8   i2e_cid_pri;            /**< [D2.TM.TMM.AT] Priority of I2E Category ID */
};
typedef struct ctc_acl_cid_pri_s ctc_acl_cid_pri_t;

struct ctc_acl_league_s
{
       uint8  dir;               /**< [D2.TM.TMM.AT]      Direction*/
       uint8  acl_priority;      /**< [D2.TM.TMM.AT]      Alias is acl lookup level*/
       uint8  auto_move_en;      /**< [D2.TM]      Automatically move entry forward and the user must ensure that the attributes on the port/vlan/l3if are consistent*/
       uint32 lkup_level_bitmap; /**< [D2.TM.TMM.AT]      Lookup level bitmap*/
       uint8  size;              /**< [TMM.AT]        Merger size(1:160, 2: 320, 3: 480)*/
       uint16 ext_tcam_bitmap;   /**< [TM]         Expand external tcam */
       uint8* leagued_list;      /**< [TMM.AT]        Return the leagued lkup level list in order*/
       uint8  list_cnt;          /**< [TMM.AT]        The max count of the link list for input and as the real count for output*/
       uint8  global_pp_en;      /**< [AT] global lkup enable, the leagued lookup level will take effect on all PPs(do not care pp_bmp) */
       uint16 pp_bmp;            /**< [AT] pipeline bitmap */
};
typedef struct ctc_acl_league_s ctc_acl_league_t;

enum ctc_acl_reorder_mode_e
{
    CTC_ACL_REORDER_MODE_SCATTER,      /**< [D2.TM] reorder by scatter*/
    CTC_ACL_REORDER_MODE_DOWNTOUP,     /**< [D2.TM.TMM.AT] reorder key index by down to up. For example, move index 103,105,107 to 509,510,511*/
    CTC_ACL_REORDER_MODE_UPTODOWN,     /**< [D2.TM.TMM.AT] reorder key index by up to down. For example, move index 103,105,107 to 0,1,2*/
    CTC_ACL_REORDER_MODE_MAX
};
typedef enum ctc_acl_reorder_mode_e ctc_acl_reorder_mode_t;

struct ctc_acl_reorder_s
{
    uint8   mode;         /**< [D2.TM.TMM.AT] (in)     reorder mode, refer to ctc_acl_reorder_mode_t*/
    uint8   dir;          /**< [D2.TM.TMM.AT] (in)     Direction*/
    uint8   acl_priority; /**< [D2.TM.TMM.AT] (in)     Alias is acl lookup level*/
    uint16  pp_bmp;       /**< [AT] pipeline bitmap */
};
typedef struct ctc_acl_reorder_s ctc_acl_reorder_t;


struct ctc_acl_replace_s
{
    uint8   src_lkup_level;                  /**< [TMM.AT] the src lookup level*/
    uint8   dest_lkup_level;                 /**< [TMM.AT] the dest lookup level*/
    uint8   dir;                             /**< [AT] the direction */
    uint16  pp_bmp;                          /**< [AT] pipeline bitmap */
};
typedef struct ctc_acl_replace_s ctc_acl_replace_t;

enum ctc_acl_range_type_e
{
    CTC_ACL_RANGE_TYPE_VLAN_RANGE  = 0,     /**< [TMA] svlan/cvlan range */
    CTC_ACL_RANGE_TYPE_PKT_LENGTH  = 1,     /**< [TMA] Packet length */
    CTC_ACL_RANGE_TYPE_L4_SRC_PORT = 2,     /**< [TMA] Tcp or Udp src port */
    CTC_ACL_RANGE_TYPE_L4_DST_PORT = 3,     /**< [TMA] Tcp or Udp dest port */
    CTC_ACL_RANGE_TYPE_NUM
};

struct ctc_acl_range_s
{
    uint8 type;                     /**< [TMA] refer to ctc_acl_range_type*/
    uint16 min;                     /**< [TMA] Min value for the range */
    uint16 max;                     /**< [TMA] Max value for the range */
};
typedef struct ctc_acl_range_s ctc_acl_range_t;

#ifdef __cplusplus
}
#endif

#endif

